import request from "@/utils/request";

// 获取权限树
export function getRoleGroupTree(groupid) {
  return request({
    url: "/roleAction/getRoleGroupTree?groupid=" + groupid,
    method: "get",
  });
}

// 获取角色
export function getRoleGroup() {
  return request({
    url: "/roleAction/list",
    method: "get",
  });
}

// 更新权限组列表
export function updateRoleGroup(data) {
  return request({
    url: "/roleAction/updateRoleGroup",
    method: "put",
    data: data,
  });
}

// 新增权限组列表
export function addRole(data) {
  return request({
    url: "/roleAction/add",
    method: "post",
    data: data,
  });
}

// 删除权限组列表
export function removeRole(groupid) {
  return request({
    url: "/roleAction/"+groupid,
    method: "delete"
  });
}